<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.6"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>sline: C:/Users/zhu/Desktop/sline/Component/sline.c 文件参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">sline<span id="projectnumber">&#160;v1.1.1</span>
   </div>
   <div id="projectbrief">This is a shell component.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.6 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d522931ffa1371640980b621734a4381.html">Users</a></li><li class="navelem"><a class="el" href="dir_84f5943c2b4a25d8438a76cb00d93649.html">zhu</a></li><li class="navelem"><a class="el" href="dir_e8238830557e247603cce3caaa85a16c.html">Desktop</a></li><li class="navelem"><a class="el" href="dir_db193841dc67b21f7da766c1e5f29c12.html">sline</a></li><li class="navelem"><a class="el" href="dir_53f78a5796821c1c1f32bc361eada011.html">Component</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#func-members">函数</a> &#124;
<a href="#var-members">变量</a>  </div>
  <div class="headertitle"><div class="title">sline.c 文件参考</div></div>
</div><!--header-->
<div class="contents">

<p>sline命令行组件的功能实现  
<a href="#details">更多...</a></p>
<div class="textblock"><code>#include &lt;string.h&gt;</code><br />
<code>#include &lt;stdarg.h&gt;</code><br />
<code>#include &quot;<a class="el" href="sline_8h_source.html">sline.h</a>&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
函数</h2></td></tr>
<tr class="memitem:a22a3af99a7e77d8752e6b873428a3539"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sline_8c.html#a22a3af99a7e77d8752e6b873428a3539">sl_cmd_export_pre</a> (char *name, void *func, char *desc)</td></tr>
<tr class="memdesc:a22a3af99a7e77d8752e6b873428a3539"><td class="mdescLeft">&#160;</td><td class="mdescRight">在环境中注册指令 注意调用在sl_create之前，否则不会被注册  <br /></td></tr>
<tr class="separator:a22a3af99a7e77d8752e6b873428a3539"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8f31d5df616d2f05578db3aa07354118"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sline_8c.html#a8f31d5df616d2f05578db3aa07354118">sl_printf</a> (const char *format,...)</td></tr>
<tr class="memdesc:a8f31d5df616d2f05578db3aa07354118"><td class="mdescLeft">&#160;</td><td class="mdescRight">组件打印函数  <br /></td></tr>
<tr class="separator:a8f31d5df616d2f05578db3aa07354118"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a669a2b9d09ac50b550ef0f5d4ca8d3d1"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sline_8c.html#a669a2b9d09ac50b550ef0f5d4ca8d3d1">sl_show_allcmd</a> (int argc, char *argv[])</td></tr>
<tr class="memdesc:a669a2b9d09ac50b550ef0f5d4ca8d3d1"><td class="mdescLeft">&#160;</td><td class="mdescRight">显示所有命令  <br /></td></tr>
<tr class="separator:a669a2b9d09ac50b550ef0f5d4ca8d3d1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a897ba612c938fcc4143db946168f1c8c"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sline_8c.html#a897ba612c938fcc4143db946168f1c8c">sl_waitcmd</a> (void)</td></tr>
<tr class="memdesc:a897ba612c938fcc4143db946168f1c8c"><td class="mdescLeft">&#160;</td><td class="mdescRight">等待处理命令输入  <br /></td></tr>
<tr class="separator:a897ba612c938fcc4143db946168f1c8c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9101fb8fd693bc097cfb46edb81576c5"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sline_8c.html#a9101fb8fd693bc097cfb46edb81576c5">sl_create</a> (<a class="el" href="structsl__register__func__t.html">sl_register_func_t</a> *sl_func)</td></tr>
<tr class="memdesc:a9101fb8fd693bc097cfb46edb81576c5"><td class="mdescLeft">&#160;</td><td class="mdescRight">创建sline对象  <br /></td></tr>
<tr class="separator:a9101fb8fd693bc097cfb46edb81576c5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a22113fd5c08d2f7b480f4832f25e3669"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sline_8c.html#a22113fd5c08d2f7b480f4832f25e3669">sl_delete</a> (void)</td></tr>
<tr class="memdesc:a22113fd5c08d2f7b480f4832f25e3669"><td class="mdescLeft">&#160;</td><td class="mdescRight">关闭sline对象  <br /></td></tr>
<tr class="separator:a22113fd5c08d2f7b480f4832f25e3669"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="var-members" name="var-members"></a>
变量</h2></td></tr>
<tr class="memitem:a609b5ca322370a45d40cf486cac7038b"><td class="memItemLeft" align="right" valign="top"><a id="a609b5ca322370a45d40cf486cac7038b" name="a609b5ca322370a45d40cf486cac7038b"></a>
<a class="el" href="structsline__cmd__code__t.html">sline_cmd_code_t</a>&#160;</td><td class="memItemRight" valign="bottom"><b>__start_cmd_list</b> []</td></tr>
<tr class="memdesc:a609b5ca322370a45d40cf486cac7038b"><td class="mdescLeft">&#160;</td><td class="mdescRight">适配龙芯的GCC编译器 龙芯GCC编译的工具链会自动生成代码段的开始和结束符 <br /></td></tr>
<tr class="separator:a609b5ca322370a45d40cf486cac7038b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>sline命令行组件的功能实现 </p>
<dl class="section author"><dt>作者</dt><dd>zhuxuanlin (<a href="#" onclick="location.href='mai'+'lto:'+'xua'+'nl'+'inz'+'hu'+'@qq'+'.c'+'om'; return false;">xuanl<span class="obfuscator">.nosp@m.</span>inzh<span class="obfuscator">.nosp@m.</span>u@qq.<span class="obfuscator">.nosp@m.</span>com</a>) </dd></dl>
<dl class="section version"><dt>版本</dt><dd>1.1.1 </dd></dl>
<dl class="section date"><dt>日期</dt><dd>2023-05-18</dd></dl>
<dl class="section copyright"><dt>版权所有</dt><dd>Copyright (c) 2023 </dd></dl>
</div><h2 class="groupheader">函数说明</h2>
<a id="a22a3af99a7e77d8752e6b873428a3539" name="a22a3af99a7e77d8752e6b873428a3539"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a22a3af99a7e77d8752e6b873428a3539">&#9670;&#160;</a></span>sl_cmd_export_pre()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int sl_cmd_export_pre </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>func</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>desc</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>在环境中注册指令 注意调用在sl_create之前，否则不会被注册 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>指令名字 </td></tr>
    <tr><td class="paramname">func</td><td>指令函数指针 </td></tr>
    <tr><td class="paramname">desc</td><td>指令目的 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>int 0：正常 -1:失败 </dd></dl>

</div>
</div>
<a id="a9101fb8fd693bc097cfb46edb81576c5" name="a9101fb8fd693bc097cfb46edb81576c5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9101fb8fd693bc097cfb46edb81576c5">&#9670;&#160;</a></span>sl_create()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int sl_create </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structsl__register__func__t.html">sl_register_func_t</a> *&#160;</td>
          <td class="paramname"><em>sl_func</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>创建sline对象 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">sl_func</td><td>注册的基本函数 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>int 0：正常 -1:失败 </dd></dl>

</div>
</div>
<a id="a22113fd5c08d2f7b480f4832f25e3669" name="a22113fd5c08d2f7b480f4832f25e3669"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a22113fd5c08d2f7b480f4832f25e3669">&#9670;&#160;</a></span>sl_delete()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void sl_delete </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>关闭sline对象 </p>

</div>
</div>
<a id="a8f31d5df616d2f05578db3aa07354118" name="a8f31d5df616d2f05578db3aa07354118"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8f31d5df616d2f05578db3aa07354118">&#9670;&#160;</a></span>sl_printf()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int sl_printf </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>format</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>...</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>组件打印函数 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">format</td><td></td></tr>
    <tr><td class="paramname">...</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>int </dd></dl>

</div>
</div>
<a id="a669a2b9d09ac50b550ef0f5d4ca8d3d1" name="a669a2b9d09ac50b550ef0f5d4ca8d3d1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a669a2b9d09ac50b550ef0f5d4ca8d3d1">&#9670;&#160;</a></span>sl_show_allcmd()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int sl_show_allcmd </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>argc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>argv</em>[]&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>显示所有命令 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">argc</td><td></td></tr>
    <tr><td class="paramname">argv</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>int </dd></dl>

</div>
</div>
<a id="a897ba612c938fcc4143db946168f1c8c" name="a897ba612c938fcc4143db946168f1c8c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a897ba612c938fcc4143db946168f1c8c">&#9670;&#160;</a></span>sl_waitcmd()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int sl_waitcmd </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>等待处理命令输入 </p>
<dl class="section return"><dt>返回</dt><dd>int 0：正常 -1:失败 </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.6
</small></address>
</body>
</html>
